#

| Chapter 2 UNIX Commands |

## nm

    nm [options] objfiles

Print the symbol table (name list) in alphabetical order for one or more object files (usually ELF or COFF files). Output includes each symbol's value, type, size, name, etc. A key letter categorizing the symbol can also be displayed. Output includes each symbol's value and name, preceded by a key letter categorizing the symbol. If no object file is given, use a.out.

### Options

-e

  Report only external and static symbols; obsolete.

-f

  Report all information; obsolete.

-h

  Suppress the header.

-l

  Use with -p; indicate WEAK symbols by appending an asterisk (`*`) to key letters.

-n

  Sort the external symbols by name.

-o

  Report values in octal.

-p

  Precede each symbol with its key letter (used for parsing).

-r

  Report the object file's name on each line.

-T

  Truncate the symbol name in the display; obsolete.

-u

  Report only the undefined symbols.

-v

  Sort the external symbols by value.

-V

  Print nm's version number on standard error.

-x

  Report values in hexadecimal.

### Key letters

A

  Absolute symbol.

C

  Common symbol.

D

  Data object symbol.

F

  File symbol.

N

  Symbol with no type.

S

  Section symbol.

T

  Text symbol.

U

  Undefined symbol.

Reference: nl |  | Reference: nohup